package edu.xhu.mycat.controller;

import edu.xhu.mycat.service.BiliUserService;
import edu.xhu.model.biliuser.dtos.LoginAndRegisterDto;
import edu.xhu.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api(value = "网页端用户Controller层", tags = "网页端用户Controller层")
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/biliuser")
public class BiliUserController {

    private final BiliUserService biliUserService;

    @PostMapping("/login_auth")
    @ApiOperation("bili主页用户登录")
    public ResponseResult<?> login(@RequestBody LoginAndRegisterDto dto) {
        return biliUserService.login(dto);
    }

    @PostMapping("/register")
    @ApiOperation("bili主页用户注册")
    public ResponseResult<?> register(@RequestBody LoginAndRegisterDto dto) {
        return biliUserService.register(dto);
    }


}
